import 'package:freemusic/model/AbstractDiss.dart';

class NeteaseDiss extends AbstractDiss {

  String name;
  String description;
  String coverImgUrl;
  int playCount;
  int trackCount;           //共多少首歌曲
  @override
  List<NeteaseDiss> fromRemoteJson(Map json) {
    List<NeteaseDiss> list = List();
    if(json['code'] != 200){
      return list;
    }
    
    List playList = json['playlist'];
    playList.forEach((item){
      NeteaseDiss diss = NeteaseDiss();
      diss.id = item['id'];
      diss.name = item['name'];
      diss.description = item['description'];
      diss.coverImgUrl = item['coverImgUrl'];
      diss.playCount = item['playCount'];
      diss.trackCount = item['trackCount'];
      list.add(diss);
    });
    return list;
  }
  
}